<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<p id="js">JaveScript</p>
<div id="list">
    <p id="se"> JaveSE </p>
    <p id="me"> JaveME </p>
    <p id="ee"> JaveEE </p>
</div>

<script>
    /**
    var
        js = document.getElementById('js'),
        list = document.getElementById('list');
        list.appendChild(js);
        var newP = document.createElement('p');
        newP.id = 'newP'; // = newP.setAttribute('id','newP');
        newP.innerText = 'Hello';
        list.appendChild(newP);
        //创建一个标签节点
        var myScript = document.createElement('script');
        myScript.setAttribute('type','text/script');
        var myStyle = document.createElement('style');//创建一个空标签
        myStyle.setAttribute('type','text/css'); //
        myStyle.innerHTML = 'body{background-color:chartreuse;}';//设置标签内容
        document.getElementsByTagName('head')[0].appendChild(myStyle);
     */
    var me =document.getElementById('me');
    var js = document.getElementById('js');
    list = document.getElementById('list');
    //要包含的节点 list.insertBefore(newNote,targetNote);
    list.insertBefore(js,me);
</script>
</body>
</html>